LIB_DIR = /usr/local/lib


BASE_DIR = src
BIN_DIR = bin
BIN_FILE = jobshop
CXX = colorgcc
CPPFLAGS= -I$(BASE_DIR) -L$(LIB_DIR)
CXXFLAGS = $(CPPFLAGS) -ggdb -fPIC -Wall -O3 -fno-strict-aliasing -finline-limit=1600 -ffast-math  
LIBRARIES = -lgecodeminimodel -lgecodeset -lgecodeint -lgecodesearch -lgecodekernel
SCHEDULER = src/scheduler
TIMER = src/timer
TYPES = src/types
JOBSHOP = src/jobshop
FILES = $(JOBSHOP).cc $(TIMER).cc $(SCHEDULER).cc $(TYPES).cc
OBJECTS =  $(TIMER).o $(SCHEDULER).o $(TYPES).o
OUTPUT = bin/jobshop
OUTPUT_MATLAB = bin/jobshop.mexglx
MEX = /home/jirka/bin/matlab/bin/mex

all: bin matlab 
create:
		mkdir -p $(BIN_DIR)
bin: create $(OBJECTS)
		$(CXX) $(OBJECTS)	$(CXXFLAGS) $(LIBRARIES) -o $(OUTPUT)
matlab:
		$(MEX) -O -o $(OUTPUT_MATLAB) $(FILES) $(CPPFLAGS) $(LIBRARIES) 
src/types.o:
		$(CXX) $(CXXFLAGS) -c -o $(TYPES).o $(TYPES).cc
src/timer.o:
		$(CXX) $(CXXFLAGS)  -c -o $(TIMER).o $(TIMER).cc
src/support.o:
		$(CXX) $(CXXFLAGS)  -c -o $(SCHEDULER).o $(SCHEDULER).cc
clean:
		rm -rf src/*.o $(OUTPUT) $(OUTPUT_MATLAB) 
